# 需要开启这个参数，https://github.com/jemalloc/jemalloc/issues/1328
NGINX_HOME=${DEFAULT_NGINX_HOME:-'/opt/software/nginx'}
mkdir -p ${NGINX_HOME}
mkdir -p ${NGINX_HOME}/conf.d

\cp ./nginx.conf ${NGINX_HOME}/
\cp ./conf.d/* ${NGINX_HOME}/conf.d/

docker stop nginx && docker rm nginx
docker run -itd --name nginx --restart=always -p 80:80 -p 443:443 \
 -v ${NGINX_HOME}/html:/usr/share/nginx/html \
 -v ${NGINX_HOME}/nginx.conf:/etc/nginx/nginx.conf \
 -v ${NGINX_HOME}/conf.d:/etc/nginx/conf.d \
 nginx:1.23.1

docker logs -f nginx
